﻿using System.Text;

namespace ConsoleApp6
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            ChunkManager chunkManager = new ChunkManager(new ChunkDBConfig() { DefaultChunkSize = 1024 * 1024, FileNameStrategy = new FileNameStrategy(), StorePath = "d:/messageStore/" });
            chunkManager.Config.WriterCheckPoint =
                new FileCheckpoint(Path.Combine(chunkManager.Config.StorePath, "writeCheckpoint"));
            chunkManager.Load();
            ChunkWriter writer = new ChunkWriter(chunkManager);
            for (int i = 0; i < 10000000; i++)
            {
                Message msg = new Message();
                msg.TotalSize = 1000;
                msg.Topic = "aaa";
                msg.Body = new byte[1024];
                writer.WriteMessage(msg);
            }
        }
    }
}
